package com.yxw.job.task.livevod.fallback;

import com.yxw.live_vod_backend_facade.dto.AddVodUsageInformationDto;
import com.yxw.live_vod_backend_facade.feign.VodBackendFeignClient;
import com.yxw.live_vod_facade.dto.*;
import com.yxw.live_vod_facade.feign.OnDemandFeignClient;
import com.yxw.live_vod_facade.vo.OnDemandCommentVO;
import com.yxw.live_vod_facade.vo.PageVodInfoListVO;
import com.yxw.live_vod_facade.vo.VideoReviewVO;
import com.yxw.live_vod_facade.vo.VodSalesRevenueVo;
import com.yxw.yxnet_cd_center.common.dto.PageVO;
import com.yxw.yxnet_cd_center.common.utils.BaseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class VodFallbackFactory implements FallbackFactory<OnDemandFeignClient> {


    @Override
    public OnDemandFeignClient create(Throwable cause) {
        return new OnDemandFeignClient() {
            @Override
            public BaseResult addLikeRecord() {
                log.error(cause.getMessage());
                return new BaseResult<>("9999", "点播点赞信息从redis添加到数据库开始失败：" + cause.getMessage());
            }

            @Override
            public BaseResult handle(VideoReviewHandelDTO dto) {
                return null;
            }

            @Override
            public BaseResult<PageVO<VideoReviewVO>> pageVideoReviews(PageVideoReviewsDTO dto) {
                return null;
            }

            @Override
            public BaseResult<PageVO<PageVodInfoListVO>> pageVodInfoList(PageVodInfoListDto dto) {
                return null;
            }

            @Override
            public BaseResult<PageVO<OnDemandCommentVO>> pageVideoComments(PageOnDemandCommentDTO dto) {
                return null;
            }

            @Override
            public BaseResult deleteCommentById(Long commentId) {
                return null;
            }

            @Override
            public BaseResult deleteVideoByIds(VideoDeleteDTO dto) {
                return null;
            }

            @Override
            public BaseResult extractVodByDay() {
                log.error(cause.getMessage());
                return new BaseResult<>("9999", "抽取热门数据和最新数据放入缓存(每天凌晨执行一次)失败：" + cause.getMessage());
            }
            @Override
            public BaseResult<VodSalesRevenueVo> getVodProductOrderByVideoId(Long videoId) {
                return null;
            }

        };
    }
}
